<?php
namespace app\admin\validate;  //验证器所在的文件夹
use think\Validate;
class CategoryWords extends Validate 
{
	
    protected $rule =   [
        'category_id'  => 'require',
		'word' => 'require|unique:category_words'
        
    ];
    
    protected $message  =   [
        'word.require' => '关键词必须',
		'word.unique' => '关键词不能重复',
		'category_id.require' => '所属分类必须',
    ];
	//验证场景  如果是添加的情况
// 	protected $scene = [
// 		'add' => ['name','age'],
// 	];
 }
